#include <Color.h>
#include <ColorConvert.h>
#include <ValuePoint.h>
#include <ColorConvert.h>
#include <Average.h>

#define REDPIN 3
#define GREENPIN 6
#define BLUEPIN 5
boolean logging = true;
int maxValue;

void setup() {
  Serial.begin(9600);
  pinMode(REDPIN, OUTPUT);
  pinMode(GREENPIN, OUTPUT);
  pinMode(BLUEPIN, OUTPUT);
  debugln("initialized");    
}

void loop() {
  int color;
  for (color = 0; color < 256; color++) {
     analogWrite(REDPIN, color);
     delay(20);
  }
}

void sendColorToPin(int pin, int color) {
  int value = constrain(color, 0, 255);
  analogWrite(pin, value);
}


void debug(char* hi) {
  if (logging) {
    Serial.print(hi);
  }
}
void debugln(char* hi) {
  if (logging) {
    Serial.print(hi);
  }
}

void debug(int hi) {
  if (logging) {
    Serial.print(hi);
  }
}
void debugln(int hi) {
  if (logging) {
    Serial.print(hi);
  }
}
